package com.entity.table;

import com.mybatisflex.core.query.QueryColumn;
import com.mybatisflex.core.table.TableDef;


/**
 * 文学记述 表定义层。
 *
 * @author admin
 * @since 2024-06-25
 */
public class NarrativeTableDef extends TableDef {

    private static final long serialVersionUID = 1L;

    /**
     * 文学记述
     */
    public static final NarrativeTableDef NARRATIVE = new NarrativeTableDef();

    
    public final QueryColumn ID = new QueryColumn(this, "id");

    
    public final QueryColumn INTRO = new QueryColumn(this, "intro");

    
    public final QueryColumn IMG_URL = new QueryColumn(this, "img_url");

    
    public final QueryColumn NARRATIVENAME = new QueryColumn(this, "narrativename");

    /**
     * 所有字段。
     */
    public final QueryColumn ALL_COLUMNS = new QueryColumn(this, "*");

    /**
     * 默认字段，不包含逻辑删除或者 large 等字段。
     */
    public final QueryColumn[] DEFAULT_COLUMNS = new QueryColumn[]{ID, IMG_URL, NARRATIVENAME, INTRO};

    public NarrativeTableDef() {
        super("", "narrative");
    }

    private NarrativeTableDef(String schema, String name, String alisa) {
        super(schema, name, alisa);
    }

    public NarrativeTableDef as(String alias) {
        String key = getNameWithSchema() + "." + alias;
        return getCache(key, k -> new NarrativeTableDef("", "narrative", alias));
    }

}
